package com.haolp.sys.common.vo;

/**
 * @author 小李
 * @version 1.0
 * @date 2021/10/6 11:51
 */

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.List;

/**封装分页信息
 * <T>
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class PageObjectVO<T> {
    /**当前页码值*/
    private Integer pageCurrent;
    /**页面大小*/
    private Integer pageSize;
    /**总记录数*/
    private Integer rowCount;
    /**总页数（计算数）*/
    private Integer pageCount;
    /**当前页的记录数*/
    private List<T> records;



    public PageObjectVO(Integer pageCurrent,
                        Integer pageSize,
                        Integer rowCount,
                        List<T> records) {
        this.pageCurrent = pageCurrent;
        this.pageSize = pageSize;
        this.rowCount = rowCount;
        this.records = records;
        this.pageCount=(rowCount-1)/pageSize+1;
    }
}
